package com.card.vault.domain.another;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.card.vault.domain.user.User;

@Entity
public class Card implements Serializable {

	private static final long serialVersionUID = -8910637416675095839L;
	
	@Id @GeneratedValue
	private int id;
	
	@Column(name = "CARDTYPE", columnDefinition = "enum('Visa', 'Mastercard', 'AmericanExpress', 'Edgars', 'BP')")
	@Enumerated(EnumType.STRING)
	private CardType cardType;
	
	@Column(name = "CARDNUMBER")
	private String cardNumber;
	
	@ManyToOne(fetch=FetchType.EAGER)
	private User user = new User();

	
	public Card(){};
	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public CardType getCardType() {
		return cardType;
	}

	public void setCardType(CardType cardType) {
		
		this.cardType = cardType;
	}

	public String getCardNumber() {
		return cardNumber;
	}
	public void setCardNumber(String cardNumber) {
		this.cardNumber = cardNumber;
	}
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
}